﻿using FlyingEye.Views.DeviceAppService;
using FlyingEye.Views.DeviceOpsService;
using FlyingEye.Views.MonitorServices;
using Microsoft.Extensions.DependencyInjection;
using System.Windows;

namespace FlyingEyeAdmin.Shell
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private readonly IServiceProvider _serviceProvider;

        public MainWindow(IServiceProvider serviceProvider)
        {
            _serviceProvider = serviceProvider;
            InitializeComponent();
        }

        private void DeviceClientManagementButton_Click(object sender, RoutedEventArgs e)
        {
            _serviceProvider.GetRequiredService<DeviceClientManagementWindow>()
                .Show();
        }

        private void DeviceConfigurationManagementButton_Click(object sender, RoutedEventArgs e)
        {
            _serviceProvider.GetRequiredService<DeviceConfigurationManagementWindow>()
                .Show();
        }

        private void ReadAndWriteTestButton(object sender, RoutedEventArgs e)
        {
            _serviceProvider.GetRequiredService<DeviceHubWindow>()
                .Show();
        }

        private void MonitorClientManagementButton_Click(object sender, RoutedEventArgs e)
        {
            _serviceProvider.GetRequiredService<ClientManagementWindow>()
               .Show();
        }

        private void ReadNumericValueTaskManagementButton_Click(object sender, RoutedEventArgs e)
        {
            _serviceProvider.GetRequiredService<ReadNumericValueTaskManagementWindow>()
          .Show();
        }

        private void ReadStringValueTaskManagementButton_Click(object sender, RoutedEventArgs e)
        {
            _serviceProvider.GetRequiredService<ReadStringValueTaskManagementWindow>()
           .Show();
        }

        private void NumericValueMonitorClientManagementButton_Click(object sender, RoutedEventArgs e)
        {
            _serviceProvider.GetRequiredService<NumericValueMonitorClientManagementWindow>()
          .Show();
        }

        private void NumericValueMonitorGroupManagementButton_Click(object sender, RoutedEventArgs e)
        {
            _serviceProvider.GetRequiredService<NumericValueMonitorGroupManagementWindow>()
          .Show();
        }

        private void StringValueMonitorClientManagementButton_Click(object sender, RoutedEventArgs e)
        {
            _serviceProvider.GetRequiredService<StringValueMonitorClientManagementWindow>()
        .Show();
        }

        private void StringValueMonitorGroupManagementButton_Click(object sender, RoutedEventArgs e)
        {
            _serviceProvider.GetRequiredService<StringValueMonitorGroupManagementWindow>()
   .Show();
        }

        private void DeviceCharacteristicManagementButton(object sender, RoutedEventArgs e)
        {
            _serviceProvider.GetRequiredService<DeviceCharacteristicManagementWindow>()
   .Show();

        }

        private void DevicePartManagementButton(object sender, RoutedEventArgs e)
        {
            _serviceProvider.GetRequiredService<DevicePartManagementWindow>()
 .Show();
        }
    }
}